package com.jinsp.router_annotation.bean;

import javax.lang.model.element.Element;

/**
 * Created by luoshuai on 12/11/21
 * <p>
 * 路由表数据
 */
public class RouterBean {

    //定义组件类型
    public enum RouterType {
        ACTIVITY, SERVICE, V4FRAGMENT
    }

    private String path;                //路径名
    private String groupName;           //组名
    private Class<?> targetClass;       //目标类
    private Element element;            //类节点
    private RouterType type;            //路由类型

    public RouterBean() {
    }

    public RouterBean(String path, String groupName, Class<?> targetClass, RouterType type) {
        this.path = path;
        this.groupName = groupName;
        this.targetClass = targetClass;
        this.type = type;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public Class<?> getTargetClass() {
        return targetClass;
    }

    public void setTargetClass(Class<?> targetClass) {
        this.targetClass = targetClass;
    }

    public Element getElement() {
        return element;
    }

    public void setElement(Element element) {
        this.element = element;
    }

    public RouterType getType() {
        return type;
    }

    public void setType(RouterType type) {
        this.type = type;
    }

    public static RouterBean create(String path, String groupName, Class<?> targetClass,
                                    RouterType type) {
        return new RouterBean(path, groupName, targetClass, type);
    }
}
